import config from "@/config";
import RequestBase from "@/utils/request.js";

const baseRequest = new RequestBase(config.safetyUrl);

// 管控排查记录列表
export function getRecordList(params) {
  return baseRequest.get("/business/app/check-plan-task/check-record", params);
}

// 管控排查任务详情
export function detailTast(id) {
  return baseRequest.get(
    "/business/app/check-plan-task/task/" + id
  );
}

// 管控排查记录详情
export function detailRecord(id) {
  return baseRequest.get(
    "/business/app/check-plan-task/record/" + id
  );
}

// 处理管控排查任务
export function handle(id) {
  return baseRequest.put(`/business/app/check-plan-task/handle/${id}`);
}

// 占用任务
export function occupy(id, data) {
  return baseRequest.get(`/dbd/check-plan-task/occupy/${id}`, data);
}

// 取消占用任务
export function cancel(id) {
  return baseRequest.get(`/dbd/check-plan-task/cancel/${id}`);
}

// 检查任务
export function checkOccupy(id) {
  return baseRequest.get(`/dbd/check-plan-task/check-occupy/${id}`);
}

//我的排查任务按照风险分析单元分组
export function myTaskGroupByRiskUnit() {
  return baseRequest.get(`/business/app/check-plan-task/myTaskGroupByRiskUnit`);
}

//我的某个风险分析单元下的排查任务列表
export function myTaskByRiskId(riskIdentificationId) {
  return baseRequest.get(
    `/business/app/check-plan-task/myTaskByRiskIdentificationId/${riskIdentificationId}`
  );
}

//批量处理
export function batchHandle(checkPlanTaskIdList) {
  return baseRequest.put(
    `/business/app/check-plan-task/batch-handle/${checkPlanTaskIdList}`
  );
}

//分级管控排查位置校验
export function getPositionCheck(planTaskId) {
  return baseRequest.post(
    `/business/app/check-plan-task/position-check/${planTaskId}`
  );
}
